package com.zhuiyun.educations.api.User.mapper;


import com.zhuiyun.educations.api.User.entity.User;
import com.zhuiyun.educations.common.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.mapstruct.Mapper;

/**
* @Author yangze
* @Description
* @Date 2023/6/15 10:09
*/
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select id,user_name,login_name,phone,email,avatar_url,address,create_time\n" +
            "from user \n" +
            "where id = #{id}")
    User selectUserbyId(Integer id);

    @Update("update user set login_name=#{loginName},email=#{email},phone=#{phone},address=#{address},avatar_url=#{avatarUrl} where id=#{id}")
    Integer upPersonalById(User user);
}
